﻿<!DOCTYPE html>
<html lang="zh-CN">
<head>
   <#include "../comm/header.ftl"/>
    <link href="${req.contextPath}/lib/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="${req.contextPath}/js/bootstrap/css/bootstrap.css" type="text/css" />
    <#--<script src="${req.contextPath}/ligerUIlib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>-->
    <script src="${req.contextPath}/lib/jquery-validation/jquery.validate.min.js"></script>
    <script src="${req.contextPath}/lib/jquery-validation/jquery.metadata.js"></script>
    <script src="${req.contextPath}/lib/jquery-validation/messages_cn.js"></script>
    <script src="${req.contextPath}/js/plugins/jquery-form/jquery.form.js"></script>
    <script>
        var grid = null;//表格对象
        $(function () {
            //grid
            grid = $("#role_msg").ligerGrid({
                height: '100%',
                heightDiff: -5,
                root:'list',
                record:'total',
                pageParmName:'currentPage',
                pagesizeParmName:'pageSize',
                dataAction: 'server',
                url: '/role/getRoleData.do',
                checkbox:true,
                rownumbers:true,
                columns: [
                    {display: 'id', name: 'id',hide:true},
                    {display: '角色名称', name: 'name'},
                    {display: '角色编号', name: 'sn'},
                    {display: '备注/描述', name: 'remark'}
                ],
                toolbar: {
                    items: [
                        { text: '增加', click: addRole, icon: 'add'},
                        { line: true },
                        { text: '修改角色权限|未完成', click: "", icon: 'modify'}
                    ]
                }
            });

            //高级查询
            $("#btn_query").click(function() {
                var keyword = $("#keyword").val();
                grid.set({
                    url: '/role/getRoleData.do',
                    //以下设置字段名，为了跟PageInfo的字段名相同才能实现分页
                    root:'list',
                    record:'total',
                    pageParmName:'currentPage',
                    pagesizeParmName:'pageSize',
                    dataAction: 'server',
                    //这样提交高级查询参数
                    parms: {keyword:keyword}
                });

            });

        });

        //添加系统角色
        function addRole() {

        }


    </script>
</head>
<body style="overflow-x:hidden; padding:2px;">
    <#--可以写一些表头的内容-->
    <div id="query_div">
        <!--高级查询--->
        <form class="form-inline" id="searchForm">
            <#--<input type="hidden" name="currentPage" id="currentPage" value="1">-->
            <#--<input type="hidden" name="pageSize" id="pageSize" value="20">-->
            <div class="form-group">
                <label>关键字:</label>
                <input type="text" class="form-control input-sm" name="keyword" id="keyword"
                       placeholder="请输入关键字搜索">
            </div>

            <button type="button" id="btn_query" class="btn btn-info btn-sm">
                <span class="glyphicon glyphicon-search"></span> 查询
            </button>
        </form>
    </div>

    <div id="role_msg">
        <#--这里是数据表格-->
    </div>


</body>
</html>